package com.ptszyxx.popose.module.main.mine;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProviders;

import com.ptszyxx.popose.BR;
import com.ptszyxx.popose.BuildConfig;
import com.ptszyxx.popose.R;
import com.ptszyxx.popose.databinding.FragmentMineAgreementBinding;
import com.ptszyxx.popose.module.main.mine.vm.MineAgreementVM;
import com.ysg.base.BaseFragment;
import com.ysg.http.data.AppViewModelFactory;

/**
 * 协议
 */
public class MineAgreementFragment extends BaseFragment<FragmentMineAgreementBinding, MineAgreementVM> {

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_mine_agreement;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public MineAgreementVM initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getActivity().getApplication());
        return ViewModelProviders.of(this, factory).get(MineAgreementVM.class);
    }

    @Override
    public void initView() {
        super.initView();
        binding.tvVersion.setText("V" + BuildConfig.VERSION_NAME);
    }
}
